#include <QApplication>
#include <qtabwidget.h>
#include "SerialPage.h"
#include "nlohmann/json.hpp"
#include "CmdJsonManager/CmdJsonManager.h"
#include "SimpleAES/SimpleAES.h"

int main(int argc, char* argv[])
{
    QApplication a(argc, argv);
    a.setWindowIcon(QIcon(":/icon/resource/favicon.ico"));
    SerialPage p;
    QTabWidget tabWidget;
    tabWidget.addTab(&p, "serial");
    tabWidget.addTab(new QWidget(), "mqtt");
    tabWidget.show();
    
    nlohmann::json ex1 = nlohmann::json::parse(R"(
            { 
                "pi":3.14,
                "happy":true
            }
        )");
    std::cout << "json object:" << ex1 << std::endl;
    std::cout << "json string:" << ex1.dump() << std::endl;
    std::cout << "json string:" << ex1.dump(4) << std::endl;

    CmdJsonManager::initAllCmds();

    return a.exec();
}
